package cn.edu.nju.software.service.impl;

import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import cn.edu.nju.software.bean.show.BookItemInOrder;
import cn.edu.nju.software.bean.storage.Order;
import cn.edu.nju.software.dao.intf.OrderDao;
import cn.edu.nju.software.service.intf.TransactionService;

public class TransactionServiceImpl implements TransactionService {
	
	private OrderDao orderDao;

	public void setOrderDao(OrderDao orderDao) {
		this.orderDao = orderDao;
	}

	@Override
	public int submitOrder(Order order, List<BookItemInOrder> bookList) throws SQLException {
		order.setSubmitTime(new Timestamp(System.currentTimeMillis()));
		return orderDao.submitOrder(order, bookList);
	}

}
